import { EntitySchema } from '@mikro-orm/core';

export class TypechoSpace {
  id!: number;
  uid?: number = 0;
  created?: number = 0;
  modified?: number = 0;
  text?: string;
  pic?: string;
  type?: number;
  likes?: number = 0;
  toid?: number = 0;
  status?: number = 1;
}

export const TypechoSpaceSchema = new EntitySchema({
  class: TypechoSpace,
  properties: {
    id: { primary: true, type: 'number' },
    uid: { type: 'number', nullable: true, default: 0 },
    created: { type: 'number', nullable: true, default: 0 },
    modified: { type: 'number', nullable: true, default: 0 },
    text: { type: 'string', columnType: 'text', nullable: true },
    pic: { type: 'string', columnType: 'text', nullable: true },
    type: { type: 'number', nullable: true },
    likes: { type: 'number', nullable: true, default: 0 },
    toid: { type: 'number', nullable: true, default: 0 },
    status: { type: 'number', nullable: true, default: 1 },
  },
});
